package com.woniu.sharepark.util.alipay;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    /**
     * 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
     */
    public static String app_id = "2016092900621744";

    /**
     * 商户私钥，您的PKCS8格式RSA2私钥
     *
     */
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC5vCiFWh74q8RpiC2g1k+ouc8eASCrWT95PdneNm1pHbA2FZnfA+Ky59VCdocIeXsRTbeGXydKf1LEUL3Vh25mqzYUBjLq6Bgyso4FTbPL6iXsOaWsugl7H2WECP0S8IToI6zcI+x1SGvJTrf5dfbQe5+TlovMsmHPbfT78L4yqiaDyMkSYwezj36sGGnCoYx+Xw9Mwlo4TwAy1H/Ca+qkYN73kXJFRBDDdNyCMVa8G1Hn/LcMm1eLYFI0zhIZr7QxKMwlKfSQTT7P0Y9sHUTSRuq33lEze9RYOtfkbg09Bds8AQTC3K7bwuXcCRF1gEJGbQg7jvIKvQJ/Nefnz9ehAgMBAAECggEAXSTRJV72nTp2u33BdCFFvZXBGojyOzv8qu6rrdaZs9dhoR3gFok6TQIaXsRWH5fccecJnGdnquKDPVRIfyb15KMD8bLSIh/W0sXclyhKfH6mGfsm7KI3UvmBzV88mxznagtKCvQxBvgUpdXGSWIxLohwlHExFqx2hLHd4+LtXzY9kO1tPgAa+H7tOZ4eBGlwzi5jQRPtpKiImWwuQBKd0GLR81p65F2KrNGwYEBp9UCEczbQXDGddNU4tHCre+8M+gmXl22tkfV6hJ29IgvXRsLG/vgbXWFj/+QgZ8dCdCMnbmQHzPGhXDwH2phli4053AzjfgXXwvZMC6N0NTBQqQKBgQDu2Irh4gZO/4snAM5riHhZg39eSu08saY0YJZ6e09FB4io6UUc3/mAL0whXgg9fwMZYIVP7SAX1c6/tx7ynuYKzAxGLm4GTP9YkU9q4N/fycOWME3jcKlWlZ2ezfdgh8+uS+Sj4dVcbWhMGeY2BByLn/ybrRqcIKJxFe7IzcJ48wKBgQDHExxkgY/bnBbeC1HI/dxzTmFe2c1l/gERuM/uOEJJBbqkBcICztTklx29Krp9gP9IN/25IqzabjbY4Hi9RMXyawbbS1yZQR16XOpZQ06FRp+rUZ+FiaTCA8sRZQsuiwNExsUbUFc8o09GQNFdjeBcZP0J0DtOAou8wDmNzAQSGwKBgQDD6+8o0V55aNe9m8S3os+OJfbR40ZtlhAPQPfO6t2gc0ifvhIKWJNymdmqOVcrEsf5Bhr08D92LdWVn+IMBVoQm0aqPyXTl0+SWEg8FNCv4vLEfUU2/1B5DOupu6xji6RJhkm8QODjG4AFhO05e+/qfMca8Ek2rvJxLxubrmULDwKBgCChO0gmDGRco0rl5BPjuFyV/lPDs20CQz6aYkqTohnB/KOh5fj72d1V/6Pf+w1TNYSq2MWdr2NmKUtHD8NGIIPpkwgixBzClYhW7nqPE7G4r7cu+8yxkPXUFVbWjwyj8Hc3dVtSwdnIktfbC/YfqSS70NXo8a+Jr0nS4Bwj0o79AoGACLo1bK7AzsKhVEmkMlHJ6eE6Ew+FcKDcf3WhEPINt6LSoNRX1gWCqrN/oEMv2wbvSQs8g48KKf/BYiod4ktqVm4dSnB9v7tF+K6SkaTF8TbL7NbVlMYPzNzHJ5HvptWqBNt0XShr4RK1apHOYz3lMz9eGEP721sniOFdD8HWnM4=";
    /**
     * 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
     */
    public static String alipay_public_key ="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAubwohVoe+KvEaYgtoNZPqLnPHgEgq1k/eT3Z3jZtaR2wNhWZ3wPisufVQnaHCHl7EU23hl8nSn9SxFC91YduZqs2FAYy6ugYMrKOBU2zy+ol7DmlrLoJex9lhAj9EvCE6COs3CPsdUhryU63+XX20Hufk5aLzLJhz230+/C+Mqomg8jJEmMHs49+rBhpwqGMfl8PTMJaOE8AMtR/wmvqpGDe95FyRUQQw3TcgjFWvBtR5/y3DJtXi2BSNM4SGa+0MSjMJSn0kE0+z9GPbB1E0kbqt95RM3vUWDrX5G4NPQXbPAEEwtyu28Ll3AkRdYBCRm0IO47yCr0CfzXn58/XoQIDAQAB";
    /**
     *  服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
     *
     */
    public static String notify_url = "http://fud5h4.natappfree.cc/sharepark/alipay/alipayNotifyNotice";

    /**
     * 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
     *
     */
    public static String return_url = "http://fud5h4.natappfree.cc/sharepark/user";

    /**
     * 签名方式
     */
    public static String sign_type = "RSA2";

    /**
     * 字符编码格式
     */
    public static String charset = "utf-8";

    /**
     * 支付宝网关
     */

    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


    //↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

